package com.yadang.infra.controller;

import com.yadang.infra.base.ApiResult;
import com.yadang.infra.bean.dto.CodeToNameDto;
import com.yadang.infra.service.StaffInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.invoke.MethodHandles;
import java.util.List;

@Api(tags = "用户编号转用户名称接口")
@RestController
@RequestMapping("/infra/codetoname")
public class StaffInfoController {

    private static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

    @Autowired
    private StaffInfoService staffInfoService;

    @ApiOperation("条件查询所有的字典数据")
    @PostMapping("selectAll")
    public ApiResult<?> selectAll() {
        List<CodeToNameDto> list = staffInfoService.selectAll();
        return ApiResult.success(list);
    }


}
